from django.http import HttpResponse,JsonResponse
import json

def res_ok(data):
    res={"code":0,"msg":"ok", "data":data}
    return JsonResponse(res,safe=False)

def res_err(err_msg):
        return JsonResponse({
            "code": -1,
            "msg": str(err_msg)
        }, safe=False)
